// 导入vue
import Vue from 'vue'
// 引入app主组件
import App from './App.vue'
// 引入路由
import router from './router'
// 引入vuex
import store from './store'
// 导入字体图标css，重置样式css
import './assets/fonts/iconfont.css'
import './assets/css/reset.css'
// 导入vant
import {
  Button, Icon, Tabbar, TabbarItem, Swipe, SwipeItem, Grid, GridItem, PullRefresh, List, NavBar, GoodsAction,
  GoodsActionIcon, GoodsActionButton, Popup, Card, Stepper, Checkbox, SwipeCell, SubmitBar, Sidebar, SidebarItem,
  Form, Field, ContactCard, AddressList, AddressEdit, Search, Lazyload, CouponCell, CouponList
} from 'vant'
// 引入自定义loading组件
import loading from './assets/imgs/loading.gif'
import $loading from './plugins/Loading'
// 使用自定义组件
Vue.use($loading)
// 使用vant
Vue.use(Button)
  .use(Icon)
  .use(CouponCell)
  .use(CouponList)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(PullRefresh)
  .use(List)
  .use(NavBar)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Popup)
  .use(Card)
  .use(Stepper)
  .use(Checkbox)
  .use(SwipeCell)
  .use(SubmitBar)
  .use(Sidebar)
  .use(SidebarItem)
  .use(Form)
  .use(Field)
  .use(ContactCard)
  .use(AddressList)
  .use(AddressEdit)
  .use(Search)

/*
等待webpack编译之后再运行的
  */
// eslint-disable-next-line no-undef
Vue.use(Lazyload, {
  loading: loading,
  error: loading,
  preload: 1,
  attempt: 3
})
// 使用图片懒加载
// 组织你产生生产模式的消息
Vue.config.productionTip = false
// 新建一个vue实例并挂载到app上，里面注册路由组件和vuex
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
